import shutil
import os
wrongFiles=os.listdir("wrongSample/")
for wrongFile in wrongFiles:
    with open("/media/oldzhang/Data&Model&Course/data/foodDete/plus.txt" ,"a") as f: 
        if os.path.isfile("/media/oldzhang/Data&Model&Course/data/foodDete/images/train/"+wrongFile):
                f.write("/media/oldzhang/Data&Model&Course/data/foodDete/images/"+wrongFile)
                f.write("\t")
                f.write("/media/oldzhang/Data&Model&Course/data/foodDete/annotations/"+wrongFile[:wrongFile.rfind(".")]+".xml")
                f.write("\n")
    # if not os.path.isfile("/home/oldzhang/PycharmProjects/foodDete/wrongSample/"+wrongFile):
    #     shutil.move("output/"+wrongFile,"wrongSample/")